home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / postscript.693 < prev    next >
Text File  |  1992-02-06  |  2KB  |  70 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f3\fmodern Courier;\f1\fswiss Helvetica;}
  2. \paperw11440
  3. \paperh9000
  4. \margl120
  5. \margr120
  6. {\colortbl\red0\green0\blue0;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ul0\fs28 PostScript pswrap PSsendfloatarray   PSgetfloatarray  PSsendfloat\
  8.     \
  9. Q:  What does 
  10. \f3\fs24 PSgetfloatarray()
  11. \f0\fs28  expect on the stack?  The following code snippet doesn't work:\
  12. \
  13.  
  14. \pard\tx620\tx1240\tx1860\tx2480\tx3100\tx3720\tx4340\tx4980\tx5600\tx6220\f3\fs24\fc0         float theFloat[4];\
  15.     \
  16.         theFloat[0] = 1.0;\
  17.         theFloat[1] = 2.0;\
  18.         theFloat[2] = 3.0;\
  19.         theFloat[3] = 4.0;\
  20.         PSsendfloatarray(&theFloat[0], 4);\
  21.         theFloat[0] = 0.0;\
  22.         theFloat[1] = 0.0;\
  23.         theFloat[2] = 0.0;\
  24.         theFloat[3] = 0.0;\
  25.         PSgetfloatarray(4,&theFloat[0]);\
  26.  
  27. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\fs28 \
  28. and results in these DPS errors:\
  29.     
  30. \i \
  31.  
  32. \pard\tx620\tx1240\tx1860\tx2480\tx3100\tx3720\tx4340\tx4980\tx5600\tx6220\f3\i0\fs24\fc0 DPS client library error: Invalid tag of returned object, DPSContext 76128, data 428272\
  33. ?DPS client library error: Invalid tag in returned object, DPSContext 76128, data 428320\
  34. @@@DPS client library error: Invalid tag in returned object, DPSContext 76128, data 428700                                                                     (-\
  35.  ;Errorstackunderflowprintobject\
  36.  
  37. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\fs28 \
  38. \
  39. A:  There is a known bug in 1.0 and 2.0 which causes the behavior of 
  40. \f3\fs24 PSsendfloatarray()
  41. \f0\fs28  and 
  42. \f3\fs24 PSgetfloatarray()
  43. \f0\fs28  to be unsymmetric.  
  44. \f3\fs24 PSsendfloatarray()
  45. \f0\fs28  pushes the 
  46. \i array
  47. \i0  onto the stack -- not the individual elements of the array.  
  48. \f3\fs24 PSgetfloatarray()
  49. \f0\fs28  expects the individual elements of the array to be on the stack.  For example, the following code will work:\
  50. \
  51.  
  52. \pard\tx620\tx1240\tx1860\tx2480\tx3100\tx3720\tx4340\tx4980\tx5600\tx6220\f3\fs24\fc0         float theFloat[4];\
  53. \
  54.         PSsendfloat(1.0);\
  55.         PSsendfloat(2.0);\
  56.         PSsendfloat(3.0);\
  57.         PSsendfloat(4.0);\
  58.         PSgetfloatarray(4,&theFloat[0]);\
  59.  
  60. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\fs28 \
  61. \
  62. QA693\
  63. \
  64. See also:  postscript.674  and postscript.341.\
  65. \
  66. Valid for 1.0\
  67. Valid for 2.0                \
  68. \
  69.  
  70.